{% extends "DrinkiitBlogBundle::layout.html.twig" %}

{% block suiveur %} <a href="{{ path('admin_index') }}">Accueil</a> > <a href="{{ path('admin_management_user') }}">Utilisateurs</a> > <a href="{{ path('admin_management_one_user', {'id': user.getId }) }}">{{ user.getUsername }}</a> {% endblock %}

{% block title %}{{ titre }}{% endblock %}

{% block content %}

<p><a href="{{ path('admin_management_user') }}">Retour aux utilisateurs</a></p>
{% if user is defined and user is not empty %}
<table><form method="post" {{ form_enctype(form) }}>
	<tr><th colspan="3">Info utilisateur</th></tr>
	<tr><td>Id</td><td>{{ user.getId }}</td></tr>
	<tr><td>{{ form_label(form.username) }}</td>
		<td>{{ form_widget(form.username, {'attr': {'value': user.getUsername } }) }}</td>
		<td>{{ form_errors(form.username) }}</td></tr>
	<tr><td>{{ form_label(form.nom) }}</td>
		<td>{{ form_widget(form.nom, {'attr': {'value': user.getNom } }) }}</td>
		<td>{{ form_errors(form.nom) }}</td></tr>
	<tr><td>{{ form_label(form.prenom) }}</td>
		<td>{{ form_widget(form.prenom, {'attr': {'value': user.getPrenom } }) }}</td>
		<td>{{ form_errors(form.prenom) }}</td></tr>
	<tr><td>{{ form_label(form.email) }}</td>
		<td>{{ form_widget(form.email, {'attr': {'value': user.getEmail } }) }}</td>
		<td>{{ form_errors(form.email) }}</td></tr>
	<tr><td>{{ form_label(form.password) }}</td>
		<td>{{ form_widget(form.password, {'attr': {'value': '' } }) }}</td>
		<td>{{ form_errors(form.password) }}</td></tr>
	<tr><td>Solde</td><td>{{ user.getSolde }} €</td></tr>
	<tr><td colspan="3"><input id="submit" type="submit" /></td></tr>
	{{ form_widget(form.userid, {'attr': {'value': user.getId } }) }}
{{ form_rest(form) }}</table>
</form>

<form method="post" {{ form_enctype(form1) }}>
	
	{{ form_errors(form1) }}
	<div>
		{{ form_label(form1.operation) }}
		{{ form_errors(form1.operation) }}
		{{ form_widget(form1.operation) }}
	</div>
	<input id="submit" type="submit" />
	{{ form_rest(form1) }}
</form>

<table>
	<tr>
		<td>Date</td>
		<td>Total</td>
		<td>Valider</td>
	</tr>
{% for commande in liste_commandes %}
	
	<tr>
		<td>{{ commande.getDateCommande | date("d/m/Y") }}</td>
		<td>{{ commande.getPrix }} €</td>
		<td><a href="{{ path('admin_management_commande_payee', {'id_comm': commande.getId }) }}">Est payée</a></td>
	</tr>
	
{% endfor %}
</table>

{% else %}
<p>Utilisateur inexistant</p>
{% endif %}


{% endblock %}
